package com.wanghua.mall.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wanghua.common.utils.PageUtils;
import com.wanghua.mall.user.entity.UserEntity;
import com.wanghua.mall.user.exception.PhoneExistException;
import com.wanghua.mall.user.exception.UsernameExistException;
import com.wanghua.mall.user.vo.RegisterVo;

import java.util.Map;

/**
 * 用户
 *
 * @author wanghua
 * @email 2367279431@qq.com
 * @date 2021-08-24 18:51:22
 */
public interface UserService extends IService<UserEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 用户注册
     */
    void register(RegisterVo registerVo);

    //检查手机号是否存在
    void checkPhoneUnique(String phone) throws PhoneExistException;

    //检查用户名是否存在
    void checkUsernameUnique(String username) throws UsernameExistException;

    /**
     * 用户登录
     * @return
     */
    UserEntity login(RegisterVo registerVo);

    /**
     * 第三方账号登录->>Gitee
     * @return
     */
    UserEntity giteeLogin(String giteeUserVoJson);

}

